<?php

namespace App\Http\Controllers;

use App\Models\Category;
use Illuminate\Http\Request;

class CategoryController extends Controller
{
    //
    public function show(Request $request,Category $category){

        $categories = get_categoires_all($category->id);
        $topics = $category->topics()->with(['user','category'])
            ->topicSelect($request->input('order'))
            ->paginate();

        return view('topics.index',compact('topics','category','categories'));

    }
}
